Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upcoming: [M3-7302] - Replace NodeBalancer detail charts with Recharts #9983

Conversation

hana-akamai
Copy link
Contributor

@hana-akamai hana-akamai commented Dec 8, 2023

Description 📝

This PR is part of a bigger effort to replace chart.js with the more modern Recharts.

Changes 🔄

List any change relevant to the reviewer.

  • Replace the NodeBalancer details page charts with Recharts
  • Refactor code to use one AreaChart component

Preview 📷

Before After
connections.before.mov
connections.after.mov
traffic.before.mov
traffic.after.mov

How to test 🧪

Prerequisites

(How to setup test environment)

  • Have a NodeBalancer that's been running for a while

Verification steps

(How to verify changes)

  • Go to the Network tab of a NodeBalancer that's been running for a while
    • Confirm the updated UI and that there are no regressions in the graph, units, etc
  • Confirm there are no regressions in the Linode Network Transfer History chart from the refactoring

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@hana-akamai hana-akamai added the Recharts Effort to replace chartjs library label Dec 8, 2023
@hana-akamai hana-akamai self-assigned this Dec 8, 2023
@hana-akamai hana-akamai requested a review from a team as a code owner December 8, 2023 21:14
@hana-akamai hana-akamai requested review from carrillo-erik and cpathipa and removed request for a team December 8, 2023 21:14
Copy link

github-actions bot commented Dec 8, 2023

Coverage Report:
Base Coverage: 78.32%
Current Coverage: 78.11%

Comment on lines +67 to +71
{payload.map((item) => (
<Typography fontFamily={theme.font.bold} key={item.dataKey}>
{item.dataKey}: {tooltipValueFormatter(item.value)}
</Typography>
))}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handle displaying multiple values (e.g. traffic in and traffic out values for the nodebalancer traffic chart)

image

Comment on lines +164 to +168
timeData.push({
'Traffic In': trafficIn[i][1],
'Traffic Out': trafficOut[i][1],
t: trafficIn[i][0],
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format data to easily display stacked areas https://recharts.org/en-US/examples/StackedAreaChart

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great considering the existing NodeBalancer graphs didn't event work half of the time!

Something seems wrong with the max value on the traffic graph.
Screenshot 2023-12-12 at 10 37 55 AM

Screenshot 2023-12-12 at 10 35 25 AM

Copy link
Contributor

@cpathipa cpathipa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observation: Looks like like there is a difference in y-axis / x-axis points compared to prod and this branch.

Prod This Branch
image image

Observation: Firewall section is not appearing in this branch.
Not sure if this is expected as part of this change.

Prod This Branch
image image

@hana-akamai
Copy link
Contributor Author

@cpathipa The axis points displayed are expected to be slightly different but the data at each point are still the same

Copy link
Member

@bnussman-akamai bnussman-akamai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Massive improvement considering Chart.js was very broken here!

Screen.Recording.2023-12-12.at.4.51.48.PM.mov

@hana-akamai hana-akamai added the Add'tl Approval Needed Waiting on another approval! label Dec 13, 2023
@carrillo-erik
Copy link
Contributor

The UI and data looks good. I am noticing a delay when viewing the charts in the NodeBalancer Summary page. I do not experience any delays when looking at the charts in Linodes Transfer tab. However, the same behavior occurs in PROD, will require more investigation for the cause of this.

@hana-akamai hana-akamai merged commit cc9020e into linode:develop Dec 14, 2023
17 of 18 checks passed
@hana-akamai hana-akamai deleted the M3-7302-replace-nodebalancer-detail-charts branch December 14, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Add'tl Approval Needed Waiting on another approval! Recharts Effort to replace chartjs library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants